package com.bytter.ext.uril.businessservice.service;

import com.bytter.ext.uril.businessservice.model.User;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.mongodb.core.MongoTemplate;
import org.springframework.stereotype.Service;

/**
 * @author zhangcz
 * @title: MongoDemoService
 * @projectName bytter-ext-util
 * @description: TODO
 * @date 2020/4/3016:50
 */
@Service
public class MongoDemoService {

    @Autowired
    private MongoTemplate mongoTemplate;

    public boolean add(){
        User user = new User();
        user.setName("zcz");
        user.setAge(30);
        mongoTemplate.insert(user);
        return true;
    }
}
